package com.base.mvvm

import android.app.Application
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import com.utils.LogUtils

/**
 * @describe:
 * @Author: lixiaopeng
 * @Date: 11/30/20
 */
open class BaseViewModel : AndroidViewModel, DefaultLifecycleObserver {
    private val TAG = "BaseViewModel"

    constructor(application: Application) : super(application)


    override fun onCreate(owner: LifecycleOwner) {
        LogUtils.d(TAG, "onCreate: ")
    }

    override fun onStart(owner: LifecycleOwner) {
        LogUtils.d(TAG, "onStart: ")
    }

    override fun onResume(owner: LifecycleOwner) {
        LogUtils.d(TAG, "onResume: ")
    }

    override fun onPause(owner: LifecycleOwner) {
        LogUtils.d(TAG, "onPause: ")
    }

    override fun onStop(owner: LifecycleOwner) {
        LogUtils.d(TAG, "onStop: ")
    }

    override fun onDestroy(owner: LifecycleOwner) {
        LogUtils.d(TAG, "onDestroy: ")
    }

    override fun onCleared() {
        super.onCleared()
        LogUtils.d(TAG, "onCleared: ")
    }
}